package com.totem.base.model;

import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
public class BaseVO implements Serializable {
    // MybatisPlus Page的current默认为1,若为0,则limit 0,就查不出数据
    @NotNull
    private Long current;
    // MybatisPlus Page的pageSize 默认为10,若为0,则limit 0,就查不出数据
    @NotNull
    private Long pageSize;
    private Long total;
    private List<OrderVO> orders;
    private List<FilterVO> filters;

    public Long getCurrent(){
        return current==null?0L:current;
    }
    public Long getPageSize(){
        return pageSize==null?0L:pageSize;
    }
    public Long getTotal(){
        return total==null?0L:total;
    }
    public List<OrderVO> getOrders(){
        return orders==null?new ArrayList<>():orders;
    }
    public List<FilterVO> getFilters(){
        return filters==null?new ArrayList<>():filters;
    }
}
